﻿@{
    ViewBag.Title = "Tax Declarations";
}
<!DOCTYPE html>
<html>
<body>
    <table id="taxDeclarations" class="table table-striped table-hover table-condensed">
        <thead>
            <tr>
                <th>Declaration Name</th>
                <th>Declaration Year</th>
                <th>Declaration Note</th>
            </tr>
        </thead>
        <tbody id="declarationList" data-bind="foreach: declarations">
            <tr>
                <td class='value editable'>
                    <div class="editor modal hide">
                        <div class="modal-header">
                            <h3>Edit Children</h3>
                        </div>
                        <div class="row offset1">
                            <p>
                                <label>Declaration Name</label>
                                <input type="text" data-bind="value :DeclarationName" />
                            </p>
                            <p>
                                <label>Declaration Year</label>
                                <input type="text" data-bind="value :DeclarationYear" />
                            </p>
                            <p>
                                <label>Declaration Note</label>
                                <textarea data-bind="value :DeclarationNote"></textarea>                                
                            </p>
                        </div>
                        <div class="modal-footer">
                            <a href="#" data-dismiss="modal" class="btn declarationCancel">Cancel</a>
                            <a href="#" data-dismiss="modal" class="btn btn-primary declarationSaver">Save</a>
                        </div>
                    </div>
                    <span style="color: darkgrey; font-size: 10pt; font-weight: bold" data-bind="text : DeclarationName"></span>
                </td>
                <td>
                    <span style="color: darkgrey; font-size: 10pt; font-weight: bold" data-bind="text : DeclarationYear"></span>
                </td>                
                <td>
                    <span style="color: darkgrey; font-size: 10pt; font-weight: bold" data-bind="text : DeclarationNote"></span>
                </td>
                <td>
                    <button class="declarationDeleter btn btn-danger">
                        Delete
                    </button>
                </td>
            </tr>
        </tbody>
    </table>
    <div class="pull-right">
        <a id="new-taxDeclaration" class="btn btn-success"
            data-toggle="modal" href="#taxDeclaration-modal">Add Declaration</a>
    </div>
    <div class="modal hide fade" id="taxDeclaration-modal">
        <div class="modal-header">
            <button type="button" class="close"
                data-dismiss="modal">
                ×</button>
            <h3>tax Declaration</h3>
            <div class="row offset1">
                <p>
                    <label>Declaration Name</label>
                    <input type="text" data-bind="value :newDeclaration().DeclarationName" />
                </p>
                <p>
                    <label>Declaration Year</label>
                    <input type="text" data-bind="value :newDeclaration().DeclarationYear" />
                </p>
                <p>
                    <label>Declaration Note</label>
                    <textarea data-bind="value :newDeclaration().DeclarationNote"></textarea>
                </p>
            </div>
            <div class="modal-footer">
                <a href="#" data-dismiss="modal" class="btn">Cancel</a>
                <a href="#" data-dismiss="modal" class="btn btn-primary declarationAdd" data-bind="click : addDeclaration">Save</a>
            </div>
        </div>
    </div>

    @Scripts.Render("~/bundles/declaration")

</body>
</html>
